import turtle

def draw_go_board(size=30, lines=15):
    # 设置画笔
    pen = turtle.Turtle()
    pen.speed(10)  # 绘制速度
    pen.penup()
    # 计算棋盘起始位置（让棋盘居中）
    start_x = - (lines - 1) * size / 2
    start_y = (lines - 1) * size / 2

    # 绘制横线
    for i in range(lines):
        pen.goto(start_x, start_y - i * size)
        pen.pendown()
        pen.goto(start_x + (lines - 1) * size, start_y - i * size)
        pen.penup()

    # 绘制竖线
    for i in range(lines):
        pen.goto(start_x + i * size, start_y)
        pen.pendown()
        pen.goto(start_x + i * size, start_y - (lines - 1) * size)
        pen.penup()

    # 隐藏画笔
    pen.hideturtle()
    # 保持窗口显示
    turtle.done()

# 调用函数绘制15×15的五子棋棋盘（每个格子边长30像素）
draw_go_board(size=30, lines=15)